;generic section
[walker@jup_b41_bunker_guard_gen]
;on_info = {-jup_b47_bunker_guard_arrived +jup_b47_no_bunker_guard} %+jup_b47_bunker_guard_arrived%
out_restr = jup_b41_sr_noweap
in_restr = jup_b41_sr_light
meet = meet@def
;combat_ignore_cond = {=check_enemy_name(jup_b1_stalker_)} true, {=check_enemy_name(jup_b6_freedom_stalker_)} true, {=check_enemy_name(jup_b6_duty_stalker_)} true, {=check_enemy_name(jup_b6_stalker_)} true

[meet@def]
close_victim = {=is_wounded} nil, actor
snd_on_use = {=is_wounded} nil, {=actor_enemy} nil, {=has_enemy} meet_use_no_fight, {=actor_has_weapon} meet_use_no_weapon, {=dist_to_actor_ge(3)} nil
use = {=is_wounded} false, {=actor_enemy} false, {=has_enemy} false, {=actor_has_weapon} false, {=dist_to_actor_ge(3)} false, true
trade_enable = false


[meet@animpoint_def]
close_anim 		= nil
close_victim 	= nil
far_anim 		= nil
far_victim 		= nil
close_distance 	= 0
far_distance 	= 0
snd_on_use = {=is_wounded} nil, {=actor_enemy} nil, {=has_enemy} meet_use_no_fight, {=actor_has_weapon} meet_use_no_weapon
use = {=is_wounded} false, {=actor_enemy} false, {=has_enemy} false, {=actor_has_weapon} false, true
trade_enable    = false

[death@jup_b41_bunker_guard_gen]
on_info = %=inc_counter(jup_b47_bunker_guard_dead:1)%
on_info2 = {+jup_b47_no_bunker_guard =counter_greater(jup_b47_bunker_guard_dead:4)} %+jup_b41_bunker_guards_dead%, {=counter_greater(jup_b47_bunker_guard_dead:4)} %+jup_b47_all_merc_dead +jup_b47_no_bunker_guard =set_counter(jup_b47_bunker_guard_dead:0)% 



;guard works
[logic@jup_b47_bunker_guard_01]
suitable = true ;{=target_squad_name(jup_b47_bunker_guard)} true, {=target_squad_name(jup_b47_merc_guard_squad) =check_npc_name(jup_b47_merc_01)} true
active = walker@jup_b47_bunker_guard_01_down
prior = 70
;on_death = death@jup_b41_bunker_guard_gen

[walker@jup_b47_bunker_guard_01_down]:walker@jup_b41_bunker_guard_gen
path_walk = merc_guard_06_walk
path_look = merc_guard_06_look
on_info2 = {!actor_see_npc =dist_to_actor_ge(120) !npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_01 %=teleport_npc(jup_b41_merc_guard_01_walk)%
on_info3 = {!actor_see_npc =actor_in_zone(jup_b41_sr_light) !npc_in_zone(jup_b41_sr_light) !npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_01 %=teleport_npc(jup_b41_merc_guard_01_walk)%
on_info4 = {=npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_01
on_info5 = {=surge_started !has_enemy} walker@jup_b47_bunker_guard_01_reach_surge_hide

[walker@jup_b47_bunker_guard_01]:walker@jup_b41_bunker_guard_gen
path_walk = merc_guard_01_walk
path_look = merc_guard_01_look
out_restr = jup_b41_sr_guards
on_info2 = {!actor_see_npc =dist_to_actor_ge(120) !npc_in_zone(jup_b41_sr_guards)} %=teleport_npc(jup_b41_merc_guard_01_walk)%
on_info3 = {=surge_started !actor_see_npc =dist_to_actor_ge(120)} walker@jup_b47_bunker_guard_01_surge_hide %=teleport_npc(jup_b41_surge_walk_1)%
on_info4 = {=surge_started !has_enemy =actor_in_zone(jup_b41_sr_light)} walker@jup_b47_bunker_guard_01_reach_surge_hide %=teleport_npc(jup_b41_merc_guard_04_walk:3)%
on_info5 = {!npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_01_down

[walker@jup_b47_bunker_guard_01_reach_surge_hide]
path_walk = surge_walk_1
path_look = surge_look_1
def_state_standing = wait_na
def_state_moving = run
on_info = {=npc_in_zone(jup_b41_sr_light)} walker@jup_b47_bunker_guard_01_surge_hide
;on_info2 = {=has_enemy} walker@jup_b47_bunker_guard_01_down
;on_info3 = {=npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_01
out_restr = jup_b41_sr_light
meet = meet@animpoint_def

[walker@jup_b47_bunker_guard_01_surge_hide]
path_walk = surge_walk_1
path_look = surge_look_1
def_state_standing = wait_na
def_state_moving = run
on_info = {=surge_complete} walker@jup_b47_bunker_guard_01_down
out_restr = jup_b41_sr_light
meet = meet@animpoint_def
combat_ignore_cond = {=actor_enemy =check_enemy_name(actor)} false, true
combat_ignore_keep_when_attacked = true
invulnerable = {!actor_enemy} true, false



[logic@jup_b47_bunker_guard_02]
suitable = true ;{=target_squad_name(jup_b47_bunker_guard)} true, {=target_squad_name(jup_b47_merc_guard_squad) !check_npc_name(jup_b47_merc_01)} true
active = walker@jup_b47_bunker_guard_02_down
prior = 70
;on_death = death@jup_b41_bunker_guard_gen

[walker@jup_b47_bunker_guard_02_down]:walker@jup_b41_bunker_guard_gen
path_walk = merc_guard_07_walk
path_look = merc_guard_07_look
on_info2 = {!actor_see_npc =dist_to_actor_ge(120) !npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_02 %=teleport_npc(jup_b41_merc_guard_02_walk)%
on_info3 = {!actor_see_npc =actor_in_zone(jup_b41_sr_light) !npc_in_zone(jup_b41_sr_light) !npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_02 %=teleport_npc(jup_b41_merc_guard_02_walk)%
on_info4 = {=npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_02
on_info5 = {=surge_started !has_enemy} walker@jup_b47_bunker_guard_02_reach_surge_hide

[walker@jup_b47_bunker_guard_02]:walker@jup_b41_bunker_guard_gen
path_walk = merc_guard_02_walk
path_look = merc_guard_02_look
out_restr = jup_b41_sr_guards
on_info2 = {!actor_see_npc =dist_to_actor_ge(120) !npc_in_zone(jup_b41_sr_guards)} %=teleport_npc(jup_b41_merc_guard_02_walk)%
on_info3 = {=surge_started !actor_see_npc =dist_to_actor_ge(120)} walker@jup_b47_bunker_guard_02_surge_hide %=teleport_npc(jup_b41_surge_walk_2)%
on_info4 = {=surge_started !has_enemy =actor_in_zone(jup_b41_sr_light)} walker@jup_b47_bunker_guard_02_reach_surge_hide %=teleport_npc(jup_b41_merc_guard_05_walk:3)%
on_info5 = {!npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_02_down

[walker@jup_b47_bunker_guard_02_reach_surge_hide]:walker@jup_b47_bunker_guard_01_reach_surge_hide
path_walk = surge_walk_2
path_look = surge_look_2
on_info = {=npc_in_zone(jup_b41_sr_light)} walker@jup_b47_bunker_guard_02_surge_hide
on_info2 = {=has_enemy} walker@jup_b47_bunker_guard_02_down
on_info3 = {=npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_02

[walker@jup_b47_bunker_guard_02_surge_hide]:walker@jup_b47_bunker_guard_01_surge_hide
path_walk = surge_walk_2
path_look = surge_look_2
on_info = {=surge_complete} walker@jup_b47_bunker_guard_02_down



[logic@jup_b47_bunker_guard_03]
suitable = true ;{=target_squad_name(jup_b47_bunker_guard)} true, {=target_squad_name(jup_b47_merc_guard_squad) !check_npc_name(jup_b47_merc_01)} true
active = walker@jup_b47_bunker_guard_03_down
prior = 70
;on_death = death@jup_b41_bunker_guard_gen

[walker@jup_b47_bunker_guard_03_down]:walker@jup_b41_bunker_guard_gen
path_walk = merc_guard_08_walk
path_look = merc_guard_08_look
on_info2 = {!actor_see_npc =dist_to_actor_ge(120) !npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_03 %=teleport_npc(jup_b41_merc_guard_03_walk)%
on_info3 = {!actor_see_npc =actor_in_zone(jup_b41_sr_light) !npc_in_zone(jup_b41_sr_light) !npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_03 %=teleport_npc(jup_b41_merc_guard_03_walk)%
on_info4 = {=npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_03
on_info5 = {=surge_started !has_enemy} walker@jup_b47_bunker_guard_03_reach_surge_hide

[walker@jup_b47_bunker_guard_03]:walker@jup_b41_bunker_guard_gen
path_walk = merc_guard_03_walk
path_look = merc_guard_03_look
out_restr = jup_b41_sr_guards
on_info2 = {!actor_see_npc =dist_to_actor_ge(120) !npc_in_zone(jup_b41_sr_guards)} %=teleport_npc(jup_b41_merc_guard_03_walk)%
on_info3 = {=surge_started !actor_see_npc =dist_to_actor_ge(120)} walker@jup_b47_bunker_guard_03_surge_hide %=teleport_npc(jup_b41_surge_walk_3)%
on_info4 = {=surge_started !has_enemy =actor_in_zone(jup_b41_sr_light)} walker@jup_b47_bunker_guard_03_reach_surge_hide %=teleport_npc(jup_b41_merc_guard_04_walk:2)%
on_info5 = {!npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_03_down

[walker@jup_b47_bunker_guard_03_reach_surge_hide]:walker@jup_b47_bunker_guard_01_reach_surge_hide
path_walk = surge_walk_3
path_look = surge_look_3
on_info = {=npc_in_zone(jup_b41_sr_light)} walker@jup_b47_bunker_guard_03_surge_hide
on_info2 = {=has_enemy} walker@jup_b47_bunker_guard_03_down
on_info3 = {=npc_in_zone(jup_b41_sr_guards)} walker@jup_b47_bunker_guard_03

[walker@jup_b47_bunker_guard_03_surge_hide]:walker@jup_b47_bunker_guard_01_surge_hide
path_walk = surge_walk_3
path_look = surge_look_3
on_info = {=surge_complete} walker@jup_b47_bunker_guard_03_down



[logic@jup_b47_bunker_guard_04]
suitable = true ;{=target_squad_name(jup_b47_bunker_guard)} true, {=target_squad_name(jup_b47_merc_guard_squad) !check_npc_name(jup_b47_merc_01)} true
active = walker@jup_b47_bunker_guard_04
prior = 70
;on_death = death@jup_b41_bunker_guard_gen

[walker@jup_b47_bunker_guard_04]:walker@jup_b41_bunker_guard_gen
path_walk = merc_guard_04_walk
path_look = merc_guard_04_look
on_info2 = {=surge_started !has_enemy} walker@jup_b47_bunker_guard_04_reach_surge_hide

[walker@jup_b47_bunker_guard_04_reach_surge_hide]:walker@jup_b47_bunker_guard_01_reach_surge_hide
on_info = {=npc_in_zone(jup_b41_sr_light)} animpoint@jup_b47_bunker_guard_04_surge_hide
on_info2 = {=has_enemy} walker@jup_b47_bunker_guard_04

[animpoint@jup_b47_bunker_guard_04_surge_hide]
cover_name = jup_b41_animp_surge_5
reach_movement = run
use_camp = false
meet = meet@animpoint_def
combat_ignore_cond = {=actor_enemy =check_enemy_name(actor)} false, true
combat_ignore_keep_when_attacked = true
invulnerable = {!actor_enemy} true, false
out_restr = jup_b41_sr_light
on_info = {=surge_complete} walker@jup_b47_bunker_guard_04



[logic@jup_b47_bunker_guard_05]
suitable = true ;{=target_squad_name(jup_b47_bunker_guard)} true, {=target_squad_name(jup_b47_merc_guard_squad) !check_npc_name(jup_b47_merc_01)} true
active = walker@jup_b47_bunker_guard_05
prior = 70
;on_death = death@jup_b41_bunker_guard_gen

[walker@jup_b47_bunker_guard_05]:walker@jup_b41_bunker_guard_gen
path_walk = merc_guard_05_walk
path_look = merc_guard_05_look
on_info2 = {=surge_started !has_enemy} walker@jup_b47_bunker_guard_05_reach_surge_hide

[walker@jup_b47_bunker_guard_05_reach_surge_hide]:walker@jup_b47_bunker_guard_01_reach_surge_hide
path_walk = surge_walk_5
path_look = surge_look_5
on_info = {=npc_in_zone(jup_b41_sr_light)} walker@jup_b47_bunker_guard_05_surge_hide
on_info2 = {=has_enemy} walker@jup_b47_bunker_guard_05

[walker@jup_b47_bunker_guard_05_surge_hide]:walker@jup_b47_bunker_guard_01_surge_hide
path_walk = surge_walk_5
path_look = surge_look_5
on_info = {=surge_complete} walker@jup_b47_bunker_guard_05
